package com.hzhetun.example.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenbingkun
 * @date 2019-03-23
 */
@RestController
@RefreshScope
public class TestController {
    @Value("${server.port}")
    private String port;

    @Value("${foo}")
    private String foo;

    @GetMapping(value = "hi")
    public String home(@RequestParam(value = "p",defaultValue = "cbk") String param){
        return "端口号："+port+",参数："+param+",foo:"+foo;
    }
}
